from langchain.schema import SystemMessage, HumanMessage, AIMessage
from langchain_community.llms import Tongyi
import os

os.environ["DASHSCOPE_API_KEY"] = 'sk-c44402d7a12c41299bb716af8d7e8bac'

llm = Tongyi()

system_message = SystemMessage(content='你是一个智能助手，叫小爱同学')
human_message = HumanMessage(content='你好')

prompt_message = [
    system_message,
    human_message
]

response = llm.invoke(prompt_message)
print(response)